package sing.myapp.ui.login

import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import io.flutter.plugin.common.MethodChannel
import sing.core.base.BaseActivity
import sing.core.util.AppActivityManager
import sing.core.util.MMkvUtil
import sing.flutter.FlutterPlugin
import sing.myapp.BR
import sing.myapp.R
import sing.myapp.databinding.ActivityLoginBinding
import sing.myapp.router.RouterURL


/**
 * 登录页
 */
@Route(path = RouterURL.PAGE_LOGIN)
class LoginActivity : BaseActivity<LoginViewModel, ActivityLoginBinding>(R.layout.activity_login,BR.loginVm) {

    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)

        val channel = MethodChannel(
            FlutterPlugin.engine.dartExecutor.binaryMessenger,
            FlutterPlugin.CHANNEL
        )
        channel.invokeMethod("toLogin","")

        AppActivityManager.finishAllActivity()
    }

    override fun initData() {
        super.initData()
        MMkvUtil().clearUserInfo()
    }
}
